home *** CD-ROM | disk | FTP | other *** search
- #include <graphics.h>
-
- /* Define the line styles */
- unsigned linestyle[16] =
- {1, 3, 7, 0xf, 0x1f, 0x3f, 0x7f, 0xff,
- 0x1ff, 0x3ff, 0x7ff, 0xfff, 0x1fff, 0x3fff, 0x7fff,
- 0xffff};
- main()
- {
- int graphdriver = DETECT, graphmode, i, y = 30;
-
- /* Detect and initialize graphics system */
- initgraph(&graphdriver, &graphmode, "c:\\turboc");
- outtextxy(10,10, "Demonstrating different line styles:");
- setcolor(RED);
- for (i=0; i<16; i++)
- {
- /* Select a line style from the array of style styles */
- setlinestyle(USERBIT_LINE, linestyle[i], NORM_WIDTH);
- moveto(0,y);
- lineto(500,y);
- y += 10;
- }
- /* Give user a chance to see the result */
- outtextxy(10, getmaxy() - 50, "Press any key to exit");
- getch();
- closegraph();
- }